package com.sz.designpattern.behavior11.templatemethod;

public abstract class PostMan {

    public final void post(){
        prepare();
        call();
        if (isSign()){
            sign();
        }else {
            refuse();
        }
    }

    protected void refuse(){

    }

    protected abstract void sign();

    protected boolean isSign() {
        return false;
    }

    protected abstract void call();

    protected void prepare() {
        System.out.println("PostMan.prepare");
    }
}
